/**
 * 
 */
package com.swg.cocobox.message.event;

import com.swg.cocobox.AbstractEventProcessor;
import com.swg.cocobox.message.MessageContext;
import com.swg.cocobox.message.MessageServer;

/**
 * @author satriaprayoga
 *
 */
public class MessageEventProcessor extends AbstractEventProcessor<MessageEvent> {

	@Override
	public void onEvent(MessageEvent event) {
		MessageServer server=(MessageServer)event.getSource();
		int type=event.getType();
		switch (type) {
		case MessageContext.CONNECTION_EVENT:
			server.fireConnectionEvent(event);
			break;
		case MessageContext.RECEIVE_EVENT:
			server.fireReceivingEvent(event);
			break;
		default:
			break;
		}
	}

}
